import request from "@/api/apiConfig";

export async function getJSSDKConfigs<T>(url: string) {
  return request<T>({
    url: "/api/common/jssdkConfigs",
    method: "POST",
    data: { url },
  });
}

// 发送验证码
export async function sendCode<T>(data: {
  mobile: string;
}) {
  return request<T>({
    url: "/consumer/sms/send",
    method: "POST",
    data,
  });
}


// 上传接口
export async function upload<T>(data: any) {
  return request<T>({
    url: "/consumer/file/oss_upload",
    method: "POST",
    data,
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

// 记录日志
export async function writeLog<T>(data: any) {
  return request<any>({
    url: "/consumer/home/logData",
    method: "GET",
    params: data,
  });
}

// 清除token
export async function clearToken<T>() {
  return request<any>({
      url: "/consumer/consumerUser/logout",
      method: "GET"
    });
}
